<?php

/*
*###########################################################################################################################*
#															    															#
#															    															#
#    **  ** ****** ** **  **  ****** ** ***   ** ***   ****** ** **  **  ** **  ** ** **  **    ****   ** **  **  ******    #
#    **  ** ****** ********** ****** *******  *******  ****** ********** ** **  ** **********  ******  ********** ******    #
#    **  ** **  ** **  **  ** **     ***   ** **    ** **     **  **  **    **  ** **  **  ** ***   ** **  **  ** **        #
#    ****** **  ** **  **  ** ****** **   *** **   *** ****** **  **  ** ** **  ** **  **  ** **       **  **  ** ******    #
#    ****** **  ** **  **  ** ****** *******  *******  ****** **  **  ** ** **  ** **  **  ** **       **  **  ** ******    #
#    **  ** **  ** **  **  ** **     *****    ******   **     **  **  ** ** **  ** **  **  ** ***   ** **  **  **     **    #
#    **  ** ****** **  **  ** ****** **       **  ***  ****** **  **  ** ** ****** **  **  **  ******  **  **  ** ******    #
#    **  ** ****** **  **  ** ****** **       **   *** ****** **  **  ** **  ** ** **  **  **   ****   **  **  ** ******    #
#															    															#
#															    															#
#															    															#
#    2010 - 2011 © HomePremiumCMS made by HomePemium as PremiumEye & Security by HomePremium and Merijnz		    		#
#															    															#
#    Powered by PhoenixPHP 3.7.1 (build 138000)										    									#
#															    															#
#															    															#
#															    															#
*###########################################################################################################################*
*/

define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include("../../inc/inc_texts.php");
$username = $core->EscapeString($_SESSION['username']);
if($users->UserPermission('forum_login', $username)){}else{header("Location: display.php");}
if(isset($_GET['id']))
{
	$query = mysql_query("SELECT * FROM forum WHERE forum_title = ".$core->EscapeString($_GET['id'])."");
	$forum = mysql_fetch_array($query);
	$queryt = mysql_query("SELECT * FROM forum_threads WHERE forum_id = ".$forum['id']."");
	while($thread = mysql_fetch_array($queryt)){
		$query = mysql_query("DELETE FROM forum_reactions WHERE thread = ".$thread['id']."");
	}
	$query = mysql_query("SELECT * FROM forum WHERE forum_title = ".$core->EscapeString($_GET['id'])."");
	$forum = mysql_fetch_array($query);
	$queryt = mysql_query("DELETE FROM forum_threads WHERE forum_id = ".$forum['id']."");
	$queryf = mysql_query("DELETE FROM forum_titles WHERE id = ".$core->EscapeString($_GET['id'])."");
	$queryh = mysql_query("DELETE FROM forum WHERE forum_title = ".$core->EscapeString($_GET['id'])."");
	}
header("Location: ../control.php?page=display");
?>
